home *** CD-ROM | disk | FTP | other *** search
/ Click - International Series 1 / Click Jigsaw Puzzles: Ken Duncan.iso / mac / puzzles / Tranquility.dxr / 00230_sticky background button.ls < prev    next >
Encoding:
Text File  |  2002-11-11  |  1.5 KB  |  58 lines

  1. property spriteNum, pBackgroundOptionSelect
  2. global puzzPicFileURL, puzzShading, puzzleImageRect, puzzleTile, puzzpicrotation
  3.  
  4. on new me, spriteRef
  5.   if the paramCount = 1 then
  6.     nothing()
  7.   else
  8.     if the paramCount = 2 then
  9.       spriteNum = spriteRef.spriteNum
  10.     end if
  11.   end if
  12.   return me
  13. end
  14.  
  15. on mouseWithin me
  16.   pBackgroundOptionSelect = 0
  17.   updateStage()
  18.   if inside(theMouseLoc(), the rect of sprite 250) then
  19.     pBackgroundOptionSelect = ((the mouseV - 23) / 24) + 1
  20.     if (pBackgroundOptionSelect >= 1) and (pBackgroundOptionSelect <= 14) then
  21.       set the locV of sprite 251 to ((the mouseV - 23) / 24 * 24) + 33
  22.       updateStage()
  23.     else
  24.       pBackgroundOptionSelect = 0
  25.       set the locV of sprite 251 to -9999
  26.     end if
  27.   else
  28.     pBackgroundOptionSelect = 0
  29.     set the locV of sprite 251 to -9999
  30.     updateStage()
  31.   end if
  32. end
  33.  
  34. on mouseUp me
  35.   set the loc of sprite 250 to point(-9999, -9999)
  36.   set the locV of sprite 251 to -9999
  37.   updateStage()
  38.   if (pBackgroundOptionSelect >= 1) and (pBackgroundOptionSelect <= 14) then
  39.     member("puzzle player tile").media = member("tile" & pBackgroundOptionSelect).media
  40.     sprite(1).visible = 0
  41.     set the member of sprite 1 to "tile"
  42.     sprite(1).visible = 1
  43.     updateStage()
  44.     puzzleTile = pBackgroundOptionSelect
  45.   end if
  46. end
  47.  
  48. on mouseLeave me
  49.   set the mouseDownScript to "clearMenu(me)"
  50.   pBackgroundOptionSelect = 0
  51.   set the locV of sprite 251 to -9999
  52.   updateStage()
  53. end
  54.  
  55. on mouseEnter me
  56.   set the mouseDownScript to EMPTY
  57. end
  58.